travel = 'No Plan';

var travel;
console.log(travel);   //No Plan

function travel() {
    console.log('Traveling');
}

travel();   //TypeError: travel is not a function

//上述代码js 解释器解释后是这样的
/*
---函数声明会移到顶部
function travel() {
    console.log('Traveling');
}

---变量声明会移到函数声明的下面
var travel;

---其余位置不变
travel = 'No Plan';
console.log(travel);   //No Plan
travel();   //TypeError: travel is not a function

*/